]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: Make sure to set currentSource if we only have one source
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 7 Feb 2013 08:27:55 +0000 (03:27 -0500)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 7 Feb 2013 10:43:50 +0000 (05:43 -0500)
This way, popping up and re-closing the switcher won't emit an error
trying to check for this._currentSource.

https://bugzilla.gnome.org/show_bug.cgi?id=693303

js/ui/status/keyboard.js

index 47c648f56e70d9d3136aef5979a492dae5aad363..8295c1a65834a9f0c0ea1f1a1e80cf020313bf43 100644 (file)
@@ -410,6 +410,9 @@ const InputSourceIndicator = new Lang.Class({
         let newSourceIndex = this._settings.get_uint(KEY_CURRENT_INPUT_SOURCE);
         let newSource = this._inputSources[newSourceIndex];
 
+        let oldSource;
+        [oldSource, this._currentSource] = [this._currentSource, newSource];
+
         if (!newSource || (nVisibleSources < 2 && !newSource.properties)) {
             // This source index might be invalid if we weren't able
             // to build a menu item for it, so we hide ourselves since
@@ -424,9 +427,6 @@ const InputSourceIndicator = new Lang.Class({
 
         this.actor.show();
 
-        let oldSource;
-        [oldSource, this._currentSource] = [this._currentSource, newSource];
-
         if (oldSource) {
             oldSource.menuItem.setShowDot(false);
             this._container.set_skip_paint(oldSource.indicatorLabel, true);